#include <iostream>
#include <vector>

using namespace std;
class Solution
{
public:
    string replaceDigits(string s)
    {
        auto shift = [](char c, int i) -> char
        {
            return c + i;
        };

        for (size_t i = 1; i < s.length(); i += 2)
        {
            s[i] = shift(s[i - 1], s[i] - '0');
        }
        return s;
    }
};
int main()
{
    Solution s;
    string str = "a1b2c3d4e";
    cout << s.replaceDigits(str) << endl;
    system("pause");
    return 0;
}
